<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>全部垃圾分类</title>
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
</head>
<body style="background-color: transparent;">
<div class="container">
    <div class="row clearfix">
        <div class="col-md-10 column">
            <div class="page-header">
                <h1><small>
                    全部垃圾分类
                </small></h1>
            </div>
        </div>
        <div class="row">
            <div class="col-md-4" align="right">
                <%--查询--%>
                <form action="${pageContext.request.contextPath}/detail/queryDetail" method="post" style="float: left;" class="form-inline">
                    <div class="form-group">
                        <span style="color: red;font-weight: bold">${error}</span>
                        <input type="text" name="getDetailByName" class="form-control" placeholder="请输入准确的垃圾名称">
                        <input type="submit" value="查询" class="btn btn-primary">
                    </div>
                </form>
        </div>
            </div>

        </div>
    </div>

    <div class="row clearfix">
        <div class="col-md-10 col-md-offset-1 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>垃圾编号</th>
                    <th>垃圾名称</th>
                    <th>垃圾类别</th>
                    <th>垃圾详情</th>
                </tr>
                </thead>
                <tbody>
                <%-- 从数据库查询--%>
                <c:forEach var="detail" items="${list}">
                    <tr>
                        <td width="50px">${detail.d_id}</td>
                        <td width="150px">${detail.d_name}</td>
                        <td width="150px">${detail.c_id==1?"干垃圾" :(detail.c_id==2?"湿垃圾"
                                :(detail.c_id==3?"可回收垃圾" :(detail.c_id==4?"有害垃圾"
                                :(detail.c_id==5?"大件垃圾" :(detail.c_id==6?"装修垃圾"
                                :(detail.c_id==7?"电子废弃物" :" "))))))}</td>
                        <td width="550px">${detail.d_detail}</td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
</html>
